<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>司机查看</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/layui/css/layui.css" >
    <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
</head>
<body>
<form class="layui-form" action="" lay-filter="example">
    <div class="layui-form-item">

        <div class="layui-form-item">
            <div class="layui-form-item">
                <label class="layui-form-label">id</label>
                <div class="layui-input-inline">
                    <input type="text" name="id" readonly autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-inline">
                    <input type="text" name="driverName" readonly autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-input-inline">
                    <input type="text" name="phoneNumber" readonly autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">注册时间</label>
                <div class="layui-input-inline">
                    <input type="text" name="registerTime" readonly autocomplete="off" class="layui-input">
                </div>
            </div>
        </div>
    </div>
</form>
</body>

<script src="/layui/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate','upload','element'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,upload = layui.upload
            ,laydate = layui.laydate
            ,element = layui.element
            , $ = layui.jquery

        // 对页面中的表单进行默认渲染
        form.render();
        laydate.render({
            elem: '#date1'
        });
        // 通过ajax 对表单中内容进行赋值
        $.ajax({
            url:"/driverAdmin/updateShow"
            ,dataType: "json"
            // 使用js的全局变量 parent.变量名
            ,data:{ id: parent.driverShowId}
            ,success:function (data) {
                // 请求后端成功后，将查询的数据设置道页面中
                if (data.code == 200 ){
                    // responseData { code:"" ; msg:"" ; data:"" }
                    form.val('example', {
                        "phoneNumber": data.data.phoneNumber
                        ,"driverName":data.data.driverName
                        ,"register":data.data.registerTime
                        ,"id":parent.driverShowId
                    });
                }
            }
        })
    });
</script>
</html>